<?php
class news_l extends SClass {

    public function process() {
        $news = ServiceUtils::GetFactory()->getNewsService()->getNewsAll();
        $newsArray = array();
        
        while ($x = $news->getNext()) {
        	$newsArray[] = array(
        	   'id' => $x->getId(),
        	   'title' => $x->getTitle(),
        	   'date' => $x->getPostdate(),
        	   'view' => Engine_LinkMaker::GetURLByContentID('controlpanel-news-view', $x->getId()),
        	   'pickUp' => Engine_LinkMaker::GetURLByContentID('controlpanel-news-pickUp', $x->getId()),
        	   'delete' => Engine_LinkMaker::GetURLByContentID('controlpanel-news-delete', $x->getId()),
        	   'edit' => Engine_LinkMaker::GetURLByContentID('controlpanel-news-edit', $x->getId())
        	);
        }
        
        $this->assign('newsArray', $newsArray);
    }

}
